<template>
	<view class="page_view">
		<view class="list">
			<view class="list-item" v-for="(item, index) in list">
				<image :src="baseUrl.cdnurl + item.user.avatar" class="list-item-left" mode=""></image>
				<view class="list-item-right">
					<view class="list-item-right-left">
						<view class="list-item-right-left-top">
							{{ item.user.nickname }}
						</view>
						<view class="list-item-right-left-bottom">
							{{ item.user.createtime }}
						</view>
					</view>
					<view class="list-item-right-right">+{{ item.reward_amount }}</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
import config from '@/utils/base.js';
export default {
	data() {
		return {
			list: [],
			page: 1,
			baseUrl: config,
			last_page: ''
		};
	},
	onLoad() {
		this.get_list();
	},
	onReachBottom() {
		if (this.page < this.last_page) {
			this.page++;
			this.get_list();
		} else {
			uni.showToast({
				title: '已经到底了哦',
				icon: 'none'
			});
		}
	},
	methods: {
		get_list() {
			let t = this;
			t.$get({
				url: '/wanlshop/user/myPartner',
				data: {
					pageSize: 10,
					page: t.page
				}
			}).then((res) => {
				console.log(res);
				if (res.code == 1) {
					t.list = [...t.list, ...res.data.data];
					t.last_page = res.data.last_page;
				}
			});
		}
	}
};
</script>

<style scoped>
.list {
	width: 100%;
	padding: 0 32rpx;
	box-sizing: border-box;
}
.list-item {
	width: 100%;
	height: 156rpx;
	display: flex;
	align-items: center;
}
.list-item-left {
	min-width: 92rpx;
	width: 92rpx;
	height: 92rpx;
	border-radius: 50%;
	background-color: aliceblue;
	margin-right: 20rpx;
}
.list-item-right {
	display: flex;
	justify-content: space-between;
	align-items: center;
	width: 100%;
	height: 156rpx;
	border-bottom: #f4f4f4 solid 2rpx;
}
.list-item-right-left-top {
	font-size: 30rpx;
	font-family: Alibaba PuHuiTi 2-65 Medium, Alibaba PuHuiTi 20;
	font-weight: normal;
	color: #1b1b33;
}
.list-item-right-left-bottom {
	font-size: 26rpx;
	font-family: Alibaba PuHuiTi-Regular, Alibaba PuHuiTi;
	font-weight: 400;
	color: #999999;
	margin-top: 6rpx;
}
.list-item-right-right {
	font-size: 36rpx;
	font-family: Alibaba PuHuiTi 2-65 Medium, Alibaba PuHuiTi 20;
	font-weight: normal;
	color: #1b1b33;
}
</style>
